<?php


class RSA
{
    private static $public_key = "-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCka7cp+jSQ6mLmhz+YNJYqGEnv
v0aMfltHI2MVWQ/nlBRa+3UxkepZkTIMnSnyhtZYfdZDs6ZDbsDBwdkIcydMtkwM
zlHBbEMTrvoJ4r/a0XaCgEeFSUfzVmeA54M0l7/08cCn0GJ/mRCEqf9NV5SAOhQP
fPEHOIn7RPBxw8nQawIDAQAB
-----END PUBLIC KEY-----
";
    private static $private_key = "-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCka7cp+jSQ6mLmhz+YNJYqGEnvv0aMfltHI2MVWQ/nlBRa+3Ux
kepZkTIMnSnyhtZYfdZDs6ZDbsDBwdkIcydMtkwMzlHBbEMTrvoJ4r/a0XaCgEeF
SUfzVmeA54M0l7/08cCn0GJ/mRCEqf9NV5SAOhQPfPEHOIn7RPBxw8nQawIDAQAB
AoGAR51HFTiOpsQAOcqU73WQJluX8J3OW6k5lp2aLZUyMTq1Nv+phuK4QTTVqNrX
h3Qlbju5FJnuBBb8TChjoKOPbM5ksnuPwBt6n1TjU04fXjt56BeznCjrd2myPMfQ
Fowv/hRlTd+B6BnGppNj+lilcrgecqqdAK3ERceXsgrcXykCQQDV+Um7Y2R5Bhqx
Ex7vso31/ZPZqxHEmIqwQtwO7c3I3q13dGB+XjpcLRsERaJCBXEZri2ApoLOR2Ut
qKhqBDOdAkEAxLbgTur+dUfoG+CMbbSORgFqZh0jeLT3VUd2qvaK/iNYo7phRHDO
7AYAEDEg2/ddtezEkabsh7QVimSoo2gppwJBANK0oT6+KXpj4HTu90/i7JiIFMgM
BXsrG6dmr3ykADkFzpwLJdpKv/11DV2vlJCe+zjmpDhDwBuRgrjrlKyRZqECQDP3
X8BZYglXiqC6rD5bAW7K9vGs5u7/V4uGynmVkdhbPBJcrU9oQbGmUCP25ohVi8MA
nlkf8MJUt5AM0WQBo2cCQQC3t7blWEggmlpi28V83GeNkDxzctwGZoqOckVjcskN
9qp76JGWZzMVOs6DGuwfbZONoskFSI2hYLYgaJ51S9fO
-----END RSA PRIVATE KEY-----
";
    public static function decryptByPrivate($data){
        openssl_private_decrypt(base64_decode($data),$result,self::$private_key);
        return $result;
    }
    public static function getPublic(){
        return self::$public_key;
    }
}